import 'package:flutter_test/flutter_test.dart';
import 'package:heic_converter/heic_converter.dart';
import 'package:heic_converter/heic_converter_platform_interface.dart';
import 'package:heic_converter/heic_converter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockHeicConverterPlatform
    with MockPlatformInterfaceMixin
    implements HeicConverterPlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> convertToJpg(String path) => Future.value("111");

  @override
  Future<String?> convertToPng(String path) => Future.value("222");

  @override
  Future<bool?> isBluetoothAudioOutput() {
    throw UnimplementedError();
  }
}

void main() {
  final HeicConverterPlatform initialPlatform = HeicConverterPlatform.instance;

  test('$MethodChannelHeicConverter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelHeicConverter>());
  });

  test('getPlatformVersion', () async {
    HeicConverter heicConverterPlugin = HeicConverter();
    MockHeicConverterPlatform fakePlatform = MockHeicConverterPlatform();
    HeicConverterPlatform.instance = fakePlatform;

    expect(await heicConverterPlugin.getPlatformVersion(), '42');
  });
}
